#pragma once
#include "MatlabInterface.h"
#include "MatlabMatrix.h"
#include <ANN/ANN.h>

using namespace matlab; 

class FMLKRGeneralizer;
class KNNSimpleGeneralizer; 
class MetricLearner:
	public matlab::MatlabInterface
{
public:
	virtual ~MetricLearner(void){};
};


class MultiVariateMetricLearner: 
	public MetricLearner
{
public:
	MultiVariateMetricLearner(KNNSimpleGeneralizer* p){parent = p; }


	virtual void transform(Observation newst, Action a)=0; 
	virtual void transformInMatlab(ANNpointArray& data, int size, Action a)=0;

	virtual int learnTransformation(ANNpointArray& data, ANNpointArray& targets, int size, int action)=0; 
	virtual void submitParams(int action)=0; //copies the tmp w matrix to the actual one. 

	KNNSimpleGeneralizer* parent; 
}; 

class SingleVariateMetricLearner:
	public MetricLearner
{
public:
	SingleVariateMetricLearner(FMLKRGeneralizer* p){parent = p; }
	virtual void transform(Observation newst, Action a, int dim)=0; 
	virtual void transformInMatlab(ANNpointArray& data, int size, Action a, int dim)=0;
	virtual void submitAPCChanges(int action, int dim)=0; 
	virtual int learnTransformation(ANNpointArray& data, Observation_type*& targets, int size, int action, int dim)=0; 

	FMLKRGeneralizer* parent; 

}; 






